package team.pikachu.pikachuclient.message;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import team.pikachu.pikachuclient.R;
import team.pikachu.pikachuclient.utils.Constants;

/**
 * Created by Alex on 2017/9/17.
 */

public class MyPromptAdapter extends RecyclerView.Adapter<MyPromptAdapter.ViewHolder> {
    private int roleId;

    public MyPromptAdapter(int roleId) {
        this.roleId = roleId;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View view = LayoutInflater.from(parent.getContext())
                    .inflate(R.layout.prompt_layout, parent, false);
            return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        if (roleId == Constants.ROLE_WORKER){
            holder.textView.setText("暂无");
        }
    }

    @Override
    public int getItemCount() {
        return 1;
    }

    class ViewHolder extends RecyclerView.ViewHolder {
        final TextView textView;
        ViewHolder(View view) {
            super(view);
            textView = (TextView) view.findViewById(R.id.prompt);
        }

    }
}
